<?php
namespace app\model\product;

use think\Model;
use app\model\question\ZxlKnowStoreQuestionModel;

class ZxlKnowStoreExamContentModel extends Model
{
    protected $name = 'zxl_know_store_exam_content';

    /**
     * 获取题目数量
     * 
     * @return int
     */
    public static function get_question_num($product_id)
    {
        $question_ids = ZxlKnowStoreExamContentModel::where(['product_id' => $product_id, 'p_id' => 0])->column('question_id');

        // 消耗时间较长暂时注释去重处理 2025-11-20 11:13
        // $question_ids = ZxlKnowStoreQuestionModel::filterMaterialQuestion($question_ids); // 去重
        return count($question_ids);
    }
}